package com.jic.order.controller.common;

import com.jic.order.service.EnumService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.Data;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@Api(value = "公共服务", tags = {"公共服务"})
@RestController
public class CommonController {

	@Data
	public static class EnumParam {
		String enumName;
	}

	@Autowired
	private EnumService enumService;

	@ApiOperation(value = "枚举信息", notes = "返回枚举json对象")
	@RequestMapping(value = "getInfos", method = RequestMethod.POST)
	public Object getInfos(@RequestBody EnumParam enumParam) {
		return enumService.getInfos(enumParam.getEnumName());
	}

}
